home *** CD-ROM | disk | FTP | other *** search
/ Canadian Geographic Explorer / Canadian Geographic Explorer.iso / pc / riddler.dxr / 00031_Question Audio loop - interrupt script.ls < prev    next >
Encoding:
Text File  |  1996-10-03  |  1.1 KB  |  37 lines

  1. on exitFrame
  2.   global gVoiceChannel, gSoundFXChannel, gMusicChannel, gPathToSound, fileDelimiter, gNumOfPlayers
  3.   if soundBusy(gVoiceChannel) then
  4.     go(the frame)
  5.   else
  6.     sound stop gSoundFXChannel
  7.   end if
  8. end
  9.  
  10. on keyDown
  11.   global gVoiceChannel, gSoundFXChannel, gMusicChannel, gPathToSound, fileDelimiter, gNumOfPlayers
  12.   set jKey to the keyPressed
  13.   if jKey = "a" then
  14.     sound playFile gVoiceChannel, gPathToSound & "qanda" & fileDelimiter & "player1.aif"
  15.   else
  16.     if (jKey = "b") and (gNumOfPlayers > 1) then
  17.       sound playFile gVoiceChannel, gPathToSound & "qanda" & fileDelimiter & "player2.aif"
  18.     else
  19.       if (jKey = "c") and (gNumOfPlayers > 2) then
  20.         sound playFile gVoiceChannel, gPathToSound & "qanda" & fileDelimiter & "player3.aif"
  21.       else
  22.         exit
  23.       end if
  24.     end if
  25.   end if
  26.   sound playFile gSoundFXChannel, gPathToSound & "soundFX" & fileDelimiter & "ticking2.aif"
  27.   set jTime to the timer
  28.   set jGuessed to 0
  29.   repeat while (the timer - jTime) < 300
  30.     set jKey to the keyPressed
  31.     if getPos(["1", "2", "3"], jKey) then
  32.       set jGuessed to 1
  33.       exit repeat
  34.     end if
  35.   end repeat
  36. end
  37.